Skip to content

Conversation

Quexington
Copy link
Contributor

It's been a couple of months since the most recent rules were added to Ruff so I figured it's time to do another pass of some low-hanging fruit of rules to enable.

This PR enables 6 new rules and deletes one unused ignore. It's highly recommended to review the PR one commit at a time and for the elif change to hide whitespace.

@Quexington Quexington requested a review from a team as a code owner August 8, 2025 19:08
@Quexington Quexington added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label Aug 8, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables 6 new Ruff linting rules and removes one unused ignore rule to improve code quality. The changes focus on simplifying control flow by collapsing else-if statements and resolving variable shadowing issues.

  • Converts nested else-if statements to elif for cleaner control flow
  • Fixes variable shadowing where loop variables or function parameters reused names in their scope
  • Removes unnecessary type casting to int where the operation already returns an integer

Reviewed Changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/cpu_utilization.py Adds noqa comment for loop variable modification
ruff.toml Removes 6 ignored Ruff rules to enable new linting checks
chia/wallet/wallet_transaction_store.py Simplifies nested else-if to elif
chia/wallet/wallet_state_manager.py Fixes variable shadowing by renaming variables
chia/wallet/wallet_node.py Converts multiple nested else-if statements to elif
chia/wallet/vc_wallet/vc_wallet.py Simplifies nested conditional structure
chia/wallet/util/merkle_utils.py Resolves variable shadowing in loop
chia/wallet/puzzle_drivers.py Converts else-if to elif
chia/wallet/nft_wallet/nft_wallet.py Fixes variable shadowing in loop
chia/wallet/cat_wallet/cat_outer_puzzle.py Resolves variable shadowing
Multiple other files Similar pattern of else-if to elif conversions and variable shadowing fixes

altendky
altendky previously approved these changes Aug 11, 2025
@emlowe
Copy link
Contributor

emlowe commented Aug 11, 2025

coverage exempted

@Starttoaster Starttoaster merged commit a803dc0 into main Aug 11, 2025
563 of 586 checks passed
@Starttoaster Starttoaster deleted the quex.ruff.august2025 branch August 11, 2025 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changed Required label for PR that categorizes merge commit message as "Changed" for changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants